package com.school_admin.mapper;

import com.school_admin.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 
 * @since 2024-03-20
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
    @Select("select * from sc_category where deleted = 0")
    List<Map> getCategoryList();

    @MapKey("postId")
    List<Map> findCategory(Integer categoryId,int start, int pageSize);
    Integer findCategoryCount(Integer categoryId);

    @Select("select * from sc_category where status = 0 and deleted= 0")
    List<Map> getCategoryList2();
    @Select("select * from sc_category where deleted = 0 and name = #{categoryName}")
    List<Category> getSearchCategoryList(String categoryName);
}
